package niuke.week4;

import java.util.Scanner;

/**
 数组异或和的定义：把数组中所有的数异或起来得到的值。给定一个整型数组arr，
 其中可能有正、有负，有零，求其中子数组的最大异或和。
 */
public class MaxSumOfYiHuo {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int [] arr = new int[num];
        for (int i = 0; i < num; i++) {
            arr[i] = sc.nextInt();
        }
        int [][]dp = new int[num][num];

        int res = Integer.MIN_VALUE;
        for (int i = 0; i < num-1; i++) {
                dp[i][i+1] = arr[i]^arr[i+1];
                res = Math.max(res,dp[i][i+1]);
        }

        for (int i = 0; i < num; i++) {
            for (int j = i+2; j < num; j++) {
                     dp[i][j] = dp[i][j-1]^arr[j];
                     res = Math.max(res, dp[i][j]);
            }
        }
        System.out.println(res);
    }
}